package com.bestsoft.flow.service.impl;

import java.util.List;
import com.bestsoft.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestsoft.flow.mapper.FlowUserGoodsMapper;
import com.bestsoft.flow.domain.FlowUserGoods;
import com.bestsoft.flow.service.IFlowUserGoodsService;

/**
 * 用户商品关系Service业务层处理
 * 
 * @author 崔健
 * @date 2023-07-11
 */
@Service
public class FlowUserGoodsServiceImpl implements IFlowUserGoodsService 
{
    @Autowired
    private FlowUserGoodsMapper flowUserGoodsMapper;

    /**
     * 查询用户商品关系
     * 
     * @param usergoodsid 用户商品关系主键
     * @return 用户商品关系
     */
    @Override
    public FlowUserGoods selectFlowUserGoodsByUsergoodsid(Long usergoodsid)
    {
        return flowUserGoodsMapper.selectFlowUserGoodsByUsergoodsid(usergoodsid);
    }

    /**
     * 查询用户商品关系列表
     * 
     * @param flowUserGoods 用户商品关系
     * @return 用户商品关系
     */
    @Override
    public List<FlowUserGoods> selectFlowUserGoodsList(FlowUserGoods flowUserGoods)
    {
        return flowUserGoodsMapper.selectFlowUserGoodsList(flowUserGoods);
    }

    /**
     * 新增用户商品关系
     * 
     * @param flowUserGoods 用户商品关系
     * @return 结果
     */
    @Override
    public int insertFlowUserGoods(FlowUserGoods flowUserGoods)
    {
        flowUserGoods.setCreateTime(DateUtils.getNowDate());
        return flowUserGoodsMapper.insertFlowUserGoods(flowUserGoods);
    }

    /**
     * 修改用户商品关系
     * 
     * @param flowUserGoods 用户商品关系
     * @return 结果
     */
    @Override
    public int updateFlowUserGoods(FlowUserGoods flowUserGoods)
    {
        flowUserGoods.setUpdateTime(DateUtils.getNowDate());
        return flowUserGoodsMapper.updateFlowUserGoods(flowUserGoods);
    }

    /**
     * 批量删除用户商品关系
     * 
     * @param usergoodsids 需要删除的用户商品关系主键
     * @return 结果
     */
    @Override
    public int deleteFlowUserGoodsByUsergoodsids(Long[] usergoodsids)
    {
        return flowUserGoodsMapper.deleteFlowUserGoodsByUsergoodsids(usergoodsids);
    }

    /**
     * 删除用户商品关系信息
     * 
     * @param usergoodsid 用户商品关系主键
     * @return 结果
     */
    @Override
    public int deleteFlowUserGoodsByUsergoodsid(Long usergoodsid)
    {
        return flowUserGoodsMapper.deleteFlowUserGoodsByUsergoodsid(usergoodsid);
    }
}
